export * from './components/index.js';
export * from './utils/index.js';

const env =
    typeof globalThis !== 'undefined'
        ? globalThis
        : typeof window !== 'undefined'
            ? window
            : // @ts-ignore
            typeof global !== 'undefined'
                ? // @ts-ignore
                global
                : {};
const importIdentifier = '__ $BLOCKSUITE_EDITOR$ __';

// @ts-ignore
if (env[importIdentifier] === true) {
    // https://github.com/yjs/yjs/issues/438
    console.error(
        '@notes/editor was already imported. This breaks constructor checks and will lead to issues!'
    );
}

if (typeof window === 'undefined') {
    throw new Error(
        'Seems like you are importing @notes/editor in SSR mode. Which is not supported for now.'
    );
}

// @ts-ignore
env[importIdentifier] = true;
